package com.caiyi.financial.nirvana.sms.service;

import com.caiyi.financial.nirvana.sms.base.service.BaseService;
import com.caiyi.financial.nirvana.sms.entity.SmsAuditBatch;
import com.caiyi.financial.nirvana.sms.mapper.SmsBatchMsgAuditMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class SmsBatchMsgAuditService extends BaseService<SmsAuditBatch> {

    @Autowired
    private SmsBatchMsgAuditMapper smsBatchMsgAuditMapper;

    @Transactional
    public void insertList(List<SmsAuditBatch> smsBatchMsgAudits) {
        try {
            int res = smsBatchMsgAuditMapper.insertList(smsBatchMsgAudits);
            logger.info("SmsBatchMsgAuditService insertList size : {} , insert into return {}", smsBatchMsgAudits.size(), res);
            if (res != smsBatchMsgAudits.size()) {
                logger.error("SmsBatchMsgAuditService DB Insert Error.");
            }
        } catch (Exception e) {
            logger.error("SmsBatchMsgAuditService smsBatchMsgMapper error  ", e);
        }
    }

}
